{
	arguments: {
		login: '<?=$_POST['login']; ?>',
		password: '<?=$_POST['password']; ?>',
		confirmPassword: '<?=$_POST['confirmPassword']; ?>',
		mail: '<?=$_POST['mail']; ?>'
	},
<?php
if (!$_POST['login'] or !$_POST['password'] or !$_POST['confirmPassword'] or !$_POST['mail']) {
?>
	type: 'error',
	error: 'Missing arguments'
<?php
} else {
	if ($_POST['password'] == $_POST['confirmPassword']) {
		$result = User::create($_POST['login'], $_POST['password'], $_POST['mail']);
		if ($result) {
?>
	type: 'success'
<?php	
		} else {
?>
	type: 'error',
	error: 'Some error ocurred'
<?php
		}
		
	} else {
?>
	type: 'error',
	error: 'Passwords don't matchs'
<?php
	}
}
?>
}
<?php
exit;
?>